﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
	xmlns:EIA_SLClient_Utility_Behaviors="clr-namespace:EIA.SLClient.Utility.Behaviors;assembly=EIA.SLClient.Utility" 
	x:Name="userControl"
	mc:Ignorable="d"
	x:Class="EIA.SLClient.ProjectManage.StaffSelector"
	d:DesignWidth="120" d:DesignHeight="24">

	<Grid x:Name="LayoutRoot">
		<Grid Height="0" VerticalAlignment="Top">
			<Popup x:Name="popup">
				<i:Interaction.Behaviors>
					<EIA_SLClient_Utility_Behaviors:PopupCloseOnClickOutsideBehavior/>
				</i:Interaction.Behaviors>
				<StackPanel Background="#FFE5E5E5" Width="{Binding ActualWidth, ElementName=userControl, Mode=OneWay}" >
					<TextBox x:Name="txt_filter" Margin="0" TextWrapping="Wrap" VerticalAlignment="Top" TextChanged="txt_filter_TextChanged"/>
					<ListBox x:Name="lst_staff" BorderThickness="1,0,1,1" MaxHeight="300" DisplayMemberPath="StfName" d:LayoutOverrides="VerticalAlignment" SelectionChanged="lst_staff_SelectionChanged" MinHeight="24"/>
				</StackPanel>
			</Popup>
		</Grid>
		<Border BorderBrush="Black" BorderThickness="1" Background="White">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="MouseLeftButtonDown">
					<ei:ChangePropertyAction TargetObject="{Binding ElementName=popup}" PropertyName="IsOpen" Value="True"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
			<TextBlock x:Name="txt_display" TextWrapping="Wrap" VerticalAlignment="Center" Margin="4,0"/>
		</Border>
	</Grid>
</UserControl>